package com.golf.core.course.loader;

import java.awt.Color;
import java.util.HashMap;

/**
 * 
 * 
 * @author garethf
 */
public class Background
{

	/** The name of the background. */
    private final String name;

    /** The colour associated with the background. */
    private final Color colour;

    
    
    private static final HashMap<String, Color> COLOUR_MAP = new HashMap<String, Color>();

    static
    {
        COLOUR_MAP.put("BLACK", Color.BLACK);
        COLOUR_MAP.put("GREEN", Color.GREEN);
        COLOUR_MAP.put("GREY", Color.GRAY);
        COLOUR_MAP.put("LIGHT_GREY", Color.LIGHT_GRAY);
        COLOUR_MAP.put("WHITE", Color.WHITE);
        COLOUR_MAP.put("RED", Color.RED);
    }

    
    /**
     * 
     * 
     * @param name
     */
    public Background(final String name)
    {
        this.name = name;
        this.colour = COLOUR_MAP.get(name);
    }

    
    /**
     * 
     * 
     * @param colour
     */
    public Background(final Color colour)
    {
        this.name = "custom";
        this.colour = colour;
    }
    
    
    /**
     * 
     * 
     * @param r
     * @param g
     * @param b
     * @param a
     */
    public Background(final int r, final int g, final int b, final int a)
    {
        this.name="rbga";
        this.colour = new Color(r, g, b, a);
    }

    
    /**
     * 
     * 
     * @return
     */
    public Color getColour()
    {
        return colour;
    }

    
    /**
     * 
     * 
     * @return
     */
    public String name()
    {
    	return name;
    }
    
}
